import {
  IsNotEmpty,
  IsString,
  IsNumber,
  IsOptional,
  MaxLength,
  Min,
} from 'class-validator';

export class CreateEmploymentDto {
  @IsNotEmpty({ message: '标题不能为空' })
  @IsString({ message: '标题必须是字符串' })
  @MaxLength(200, { message: '标题长度不能超过200个字符' })
  biaoti: string;

  @IsNotEmpty({ message: '类别不能为空' })
  @IsString({ message: '类别必须是字符串' })
  @MaxLength(100, { message: '类别长度不能超过100个字符' })
  leibie: string;

  @IsOptional()
  @IsNumber({}, { message: '点击率必须是数字' })
  @Min(0, { message: '点击率不能小于0' })
  dianjilv?: number;

  @IsOptional()
  @IsString({ message: '内容必须是字符串' })
  neirong?: string;
}
